﻿using System.ComponentModel;
using System.Windows.Forms;

namespace Marmat.Forms
{
    public partial class FileView
    {

        /// <summary>
        /// 获取附件的默认存储路径。
        /// </summary>
        /// <returns></returns>
        [Browsable(false)]
        public string AttachmentPath
        {
            get
            {
                string Path = System.IO.Path.Combine(Application.StartupPath, "Attachments");
                if (System.IO.Directory.Exists(Path) == false)
                {
                    System.IO.Directory.CreateDirectory(Path);
                }

                return Path;
            }
        }

        /// <summary>
        /// 获取或者是是否允许多文件上传。
        /// </summary>
        /// <returns></returns>
        [DefaultValue(true)]
        public bool MultiAddImage { get; set; } = true;

        /// <summary>
        /// 获取或设置是否显示重命名的命令。
        /// </summary>
        /// <returns></returns>
        [DefaultValue(false)]
        [Category("行为")]
        [Description("获取或设置是否显示重命名的命令。")]
        public bool ShowRenameCommand { get; set; }

        /// <summary>
        /// 设置筛选器
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        [DefaultValue("所有文件|*.*")]
        public string Filter { get; set; } = "所有文件|*.*";
    }
}